package com.edais.dao;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.edais.domain.ShopVouchers;
import com.edais.persistence.ShopVouchersMapper;


@Repository

public class ShopVouchersDao {
	@Autowired
	private ShopVouchersMapper shopVouchersMapper;
	
	/**
	 * 查询我的兑换券
	 * @param paramsMap
	 * @return
	 */
	public List<ShopVouchers> queryShopVochers(Map<String,Object> paramsMap) throws Exception {
		return this.shopVouchersMapper.queryShopVochers(paramsMap);
	}
	
	/**
	 * 查询我的兑换券总数
	 * @param paramsMap
	 * @return
	 */
	public int queryShopVochersCount(Map<String,Object> paramsMap) throws Exception {
		return this.shopVouchersMapper.queryShopVochersCount(paramsMap);
	}
	
	/**
	 * 查询兑换券参数表
	 * @param paramsMap
	 * @return
	 */
	public Map<String, String> selSysVoucher(Map<String, Object> paramsMap) throws Exception {
		return shopVouchersMapper.selSysVoucher(paramsMap);
	}

	/**
	 * 获取兑换券
	 * @param paramsMap
	 * @return
	 */
	public void addShopVoucher(ShopVouchers shopVour) throws Exception {
		shopVouchersMapper.addShopVoucher(shopVour);
	}

	/**
	 * 更新兑换券使用状态
	 * @param paramsMap
	 * @return
	 */
	public int updateShopVochers(Map<String, Object> paramsMap) throws Exception {
		return shopVouchersMapper.updateShopVochers(paramsMap);
	}

	/**
	 * 查询用户已使用兑换券数量（电商）
	 * @param paramsMap
	 * @return
	 */
	public int queryVouchersToShop(Map<String, Object> paramsMap) throws Exception {
		return shopVouchersMapper.queryVouchersToShop(paramsMap);
	}
	
	/**
	 * 查询用户已使用兑换券数量(备份表)（电商）
	 * @param paramsMap
	 * @return
	 */
	public int queryOldVouchersToShop(Map<String, Object> paramsMap) throws Exception {
		return shopVouchersMapper.queryOldVouchersToShop(paramsMap);
	}
}
